{:hook('body_start')}
    <style>
        ul,li {margin:0;padding: 0px;}
        .search_ropup {
         height: 232px;
         width:100%; 
         position: absolute;
         top:0px;
         background-color: #fff;
         
            }
        .search_ropup input {
         width: 406px;
         height: 34px;
         border: 1px solid #000232;
         border-radius: 10px;
         -moz-border-radius:10px;
         -ms-border-radius:10px;
         -o-border-radius:10px;
         padding: 0;margin:0;
         display: inline-block;
         float: left;
         font-size: 18px;
         color: #000232;
         padding:0 6px;
        }
        .search_ropup .search_top{
         width: 522px;
         margin:0 auto;
         margin-top: 16px;
         position: relative;
         padding-left: 100px;
         }
        .search_top .search_start{
            margin-left: 26px;
        }
        .search_top .search_start,.search_start2{
            
          display: inline-block;
          width: 70px;
          height: 34px;
          background: url(/public/images/img/search.svg) left center no-repeat;
          line-height: 36px;
          cursor: pointer;
            }
        .search_start2{
            /*background:url(/public/images/img/search2.png) left center no-repeat; */
            height: 30px;
            position: relative;
            top: 20px;
            -webkit-background-size:53px 16px;
            background-size: 53px 16px;
            background-position: center right;

        }
          #search_close{ 
             position: absolute;
             right: -264px;
             top: -8px; 
             width: 38px;
             height: 38px;
             background: url(/public/images/img/close.png) no-repeat center;
             cursor: pointer;
         }
         .search_ropup .search_btm{
             width: 876px;
             height: 136px;
             margin:0 auto;
         }
         .search_ropup .search_btm{
             padding-left: 24px;
             margin-top: 20px;
         }
         .search_ropup .search_btm p{
             font-size: 12px;
             color: #c5c5c5;
             line-height: 16px;
             margin-bottom: 10px;
         }
         .search_btm .search_item {
             width: 392px;
             height: 136px;
             border-right: 1px dashed #000232;
             padding-left: 34px;
             float:left;

         }
         .search_btm .search_item ul {
             margin-left: -10px;
             /* margin-top: 10px;*/
             height: 100px;
             overflow: hidden;
         }
         .search_btm .search_item li {
             padding: 0 8px;
             height: 20px;
             font-size:16px;
             line-height: 20px;
             border: 1px solid #000232;
             border-radius: 10px;
             -moz-border-radius:10px;
             -ms-border-radius:10px;
             -o-border-radius:10px;
             color: #000233;
             float:left;
             margin:5px 10px;
             list-style: none;
             cursor: pointer;


         }
        /*nav 样式修改*/
        .navbar .nav > li > a {
            font-size: 16px;
            font-weight: bold;
            letter-spacing: 2px;
            color: #000232;
            padding: 25px 29px 25px;
        }
        .container_nav {min-width: 1200px;}
        #menu-item-1 a{
            /*color: rgb(200, 22, 29);*/
            background-color: #fff!important;
        }
    </style>

<div class="navbar navbar-fixed-top">
    <intput id="hid_select" title="{$name}" type="hidden"></intput>
    <div class="navbar-inner">
        <div class="container container_nav">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>

            <a class="brand" href="__ROOT__/"><img style="height:50px" src="__TMPL__Public/assets/images/logo_1.png" /></a>
            <div class="nav-collapse collapse" id="main-menu" style="position: relative;">
                <?php
                    $effected_id        = "main-menu";
                    $filetpl            = "<a href='\$href' target='\$target'>\$label</a>";
                    $foldertpl          = "<a href='\$href' target='\$target' class='dropdown-toggle' data-toggle='dropdown'>\$label <b class='caret'></b></a>";
                    $ul_class           = "dropdown-menu" ;
                    $li_class           = "li-class" ;
                    $style              = "nav";
                    $showlevel          = 6;
                    $dropdown           = 'dropdown';
                    echo sp_get_menu("main",$effected_id,$filetpl,$foldertpl,$ul_class,$li_class,$style,$showlevel,$dropdown);
                ?>

                <ul class="nav pull-right " id="main-menu-user" style="font-family: 'Microsoft YaHei';">
                    <style type="text/css">
                        #user_name{
                            width: 76px;
                            overflow: hidden;
                            text-overflow:ellipsis;
                            white-space:nowrap;
                            display: inline-block;
                            height: 40px;
                            line-height: 40px;
                            vertical-align: middle;
                        }

                    </style>
                    <li class="dropdown user login">
                        <a class="dropdown-toggle user" data-toggle="dropdown" href="#">
                            <img src="__PUBLIC__/images/img/default_avatar.png" class="headicon" />
                            <span id="user_name" class="user-nicename" style="font-family:YouYuan"></span>
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu pull-right" style="margin-top: 0;">
                            <li><a style="font-family:YouYuan" href="{:U('user/center/index')}"><i class="fa fa-user"></i> &nbsp;个人中心</a></li>
                            <li class="divider"></li>
                            <li><a style="font-family:YouYuan" href="{:U('user/index/logout')}"><i class="fa fa-sign-out"></i> &nbsp;退出登陆</a></li>
                        </ul>
                    </li>
                    <li class="dropdown user offline ">
                        <a class="dropdown-toggle user" style="font-weight: bolder;font-family:YouYuan;color: #000232;" href="{:leuu('user/login/index')}">
                            登录</b>
                        </a>
                    </li>
                    <li class="dropdown user offline ">
                        <a class="dropdown-toggle user " style="font-weight: bolder;margin-left: 25px;font-family:YouYuan;color: #000232;" href="{:leuu('user/register/index')}">
                            注册
                        </a>
                    </li>
                  <!--  <li>
                        <a class="dropdown-toggle user " style="margin-left: 30px;font-family:YouYuan;color:#c8161d;" href="{:U('portal/article/edit')}">
                            投稿
                        </a>
                    </li>-->
                </ul>

                <div class="pull-right" style="margin-right:30px;margin-top: 0;">
                    <span class="search_start2" id="search_start2"></span>
                </div>
                <!-- 搜索弹窗样式和html -->
                
                <div class="search_ropup"  style="display:none;">
                    
                    <div class="search_top">
                        <input type="text" id="search_input">
                        <span class="search_start"></span>
                        <!--<span id="search_close"></span>-->
                    </div>
                    <div class ="search_btm" >
                        <div class="search_item">
                            <p>时下热词:</p>
                            <ul id="hot_list">

                            </ul>
                        </div> 
                        <div class="search_item" style="border: none;" >
                            <p>搜索历史:</p>
                            <ul id="self_list">

                            </ul>
                        </div>     
                    </div>
                    
                </div>

            </div>
        </div>
        <style>
            .layui-layer {
                top: 150px;
                left: 50%;
                margin: 0;
                padding: 0;
                background-color: #fff;
                border-radius: 20px;
                -webkit-background-clip: content;
                box-shadow: 1px 1px 50px rgba(0, 0, 0, .3);
                -webkit-animation-fill-mode: both;
                animation-fill-mode: both;
                -webkit-animation-duration: .3s;
                animation-duration: .3s;
            }
        </style>
        <tc_include file="Public:scripts" />
        <script>
            

            $(function () {
                //onclick="linkour()" 点击出现联系我们的弹窗
                $("ul#main-menu").append('<li class="li-class" id="menu-item-5"><a href="{:U(\'Portal/Index/about_us\')}" >联系我们</a></li>');

                $("#main-menu").find('a').each(function () {
                    if (GetMenu() == $(this).text()) {
                        $(this).css("color", "#C8161d");
                        $(this).css("background-color", "rgba(0,0,0,0.05)");
                    }
                });
            });
            function GetMenu() {
                var strhidMenu = $("#hid_select").attr("title");
                if (strhidMenu == "快讯") {
                    return "7&24小时";
                } else if (strhidMenu == "首页") {
                    return strhidMenu;
                } else if (strhidMenu == "活动") {
                    return strhidMenu;
                } else if (strhidMenu != "") {
                    return "产业 ";
                }
            }
            function linkour() {
                return;
                var html = "<div id=\"myModal\" style=\"position:relative;border-radius:25px; text-align: center;width: 698px;height: 598px;\">" +
                    "<div style=\"margin-top: 40px;position: absolute;width: 100%;\">" +
                    "         <img  src=\"__TMPL__Public/assets/images/lianxi/1.png\" /><br/><br/><br/>" +
                    "			    <img  src=\"__TMPL__Public/assets/images/lianxi/5.png\" /><br/><br/><br/>" +
                    "			    <img  src=\"__TMPL__Public/assets/images/lianxi/4.png\" /><br/><br/><br/>" +
                    "			    <img  src=\"__TMPL__Public/assets/images/lianxi/2.png\" /><br/><br/><br/>" +
                    "			    <div style=\"width: 120px;height: 35px;background-color: #b71d24;line-height: 35px;vertical-align: middle;border-radius: 20px;margin-left: 289px;margin-top: 33px;\">" +
                    "<a href=\"javascript:void(0);\" onclick='layer.closeAll();' style=\"color:white;\">我知道了</a></div>" +
                    "           </div>		</div>"

                layer.open({
                    type: 1,
                    title: false,
                    //skin: 'layui-layer-rim', //加上边框
                    area: ['698px', '598px'], //宽高
                    closeBtn: 0, //不显示关闭按钮
                    content: html
                });
            }

            // 搜索弹窗
            $(function(){
                $("#search_start2").click(function(){
                    $(".search_ropup").css("display","block");

                    //加载历史数据
                    $.get("{:U('portal/search/get_search_lists')}", {}, function (re) {
                        if (re.status) {

                            // 热门搜索
                            $('#hot_list').empty();
                            var html = "";
                            $.each(re.data.hot_lists, function (index, item) {
                                html += '<li class="search_keyword">' + item.keyword + '</li>';
                            })
                            $('#hot_list').append(html);

                            // 热门搜索
                            $('#self_list').empty();
                            var html = "";
                            $.each(re.data.self_lists, function (index, item) {
                                html += '<li class="search_keyword">' + item.keyword + '</li>';
                            })
                            $('#self_list').append(html);
                        }
                    })

                    close_ropup();
                });

                $('body').delegate('.search_keyword', 'click', function () {
                    var keyword = $(this).text();
                    window.location.href = "{:U('portal/search/index')}" + "&keyword=" + keyword;
                });

                $('#search_input').change(function () {
                    var keyword = $(this).val();
                    window.location.href = "{:U('portal/search/index')}" + "&keyword=" + keyword;
                });

                $('.search_start').click(function () {
                    var keyword = $('#search_input').val();
                    window.location.href = "{:U('portal/search/index')}" + "&keyword=" + keyword;
                })

                function close_ropup(){
                    $("body").click(function (e) {
                        if (!$(e.target).closest(".search_ropup, #search_start2").length) {
                            $(".search_ropup").hide() ;
                        }
                    });
                }
            })

        </script>

       
    </div>
</div>
